﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SlimDX;
using RaygunDiplomacy.Activities;
using RaygunDiplomacy.Entities;

namespace RaygunDiplomacy.Model.EntitiesModule
{
   /// <summary>
   /// The base class for every tangible object in the game
   /// </summary>
   public abstract class Entity : IEntity
   {
      #region Fields

      List<Activity> currentActivities = new List<Activity>();

      #endregion

      #region Properties

      ///<summary>
      ///</summary>
      public abstract IEntityFlyweight EntityFlyweight
      {
         get;
      }

      /// <summary>
      /// How much health the entity currently has
      /// </summary>
      public int Health
      {
         get;
         set;
      }

      /// <summary>
      /// Where the entity is in the world. This is not bound to the grid, though does correspond to it
      /// </summary>
      public Vector3 Position
      {
         get;
         set;
      }

      /// <summary>
      /// The size of the entity, in tiles/cubes
      /// </summary>
      /// <remarks>TGU: I chose Vector3, but am not sure if this shouldn't be some grouping of three ints, rather than three floats</remarks>
      public Vector3 Size
      {
         get { return this.EntityFlyweight.BaseSize; }
      }

      #endregion

      #region Constructor

      #endregion

      #region Methods

      #region Abstract

      /// <summary>
      /// Called after object creation and properties are assigned
      /// </summary>
      public abstract void Initialize();

      public abstract void Update(TimeSpan elapsed, DateTime frameNow);

      #endregion

      #endregion

      List<Statistic> statistics = new List<Statistic>();

      public List<Statistic> Statistics
      {
         get { return statistics; }
      }

      List<IEntityComponent> components = new List<IEntityComponent>();

      public List<IEntityComponent> Components
      {
         get { return components; }
      }
   }
}
